<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>
    
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>我的电商系统——后台</title>
    <base href="/tpshop2/"/>
    <link href="/tpshop2/Public/admin/css/bootstrap.min.css" rel="stylesheet">
	    <link href="/tpshop2/Public/admin/font-awesome/css/font-awesome.min.css" rel="stylesheet">

	    <!-- Toastr style -->
	    <link href="/tpshop2/Public/admin/css/plugins/toastr/toastr.min.css" rel="stylesheet">

	    <!-- Gritter -->
	    <link href="/tpshop2/Public/admin/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">

	    <link href="/tpshop2/Public/admin/css/animate.css" rel="stylesheet">
	    <link href="/tpshop2/Public/admin/css/style.css" rel="stylesheet">
    <script src="/tpshop2/Public/admin/js/jquery-2.1.1.js"></script>
    <script src="/tpshop2/Public/admin/js/bootstrap.min.js"></script>
    <script src="/tpshop2/Public/admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="/tpshop2/Public/admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>


    <!-- Custom and plugin javascript -->
    <script src="/tpshop2/Public/admin/js/inspinia.js"></script>
    <script src="/tpshop2/Public/admin/js/plugins/pace/pace.min.js"></script>

    <!-- jQuery UI -->
    <script src="/tpshop2/Public/admin/js/plugins/jquery-ui/jquery-ui.min.js"></script>
</head>

<body>

    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav metismenu" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element"> 
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                             <img style="height:50px;" src="/tpshop2/Public/img/1.jpg">
                            <span class="clear"> <span class="block m-t-xs">
                             <strong class="font-bold">
                            <?php echo $_SESSION['admin_name'];?></strong>
                             </span></span> </a>
                            
                        </div>
                    </li>

                    <li <?php if(CONTROLLER_NAME == 'Index'): ?>class="active"<?php endif; ?>>
                        <a href="<?php echo U("admin/index/index");?>"><i class="fa fa-home"></i> <span class="nav-label">主页</span></a>
                    </li>
                    <li <?php if(CONTROLLER_NAME == 'Order'): ?>class="active"<?php endif; ?>>
                        <a href="#"><i class="fa fa-shopping-cart"></i> <span class="nav-label">订单管理</span></a>
                    </li>
                     <li <?php if(CONTROLLER_NAME == 'Product'): ?>class="active"<?php endif; ?>>
                        <a href="<?php echo U("admin/product/index");?>"><i class="fa fa-gift"></i> <span class="nav-label">商品管理</span></a>
                    </li>
                     <li <?php if(CONTROLLER_NAME == 'Catalog'): ?>class="active"<?php endif; ?>>
                        <a href="<?php echo U("admin/catalog/index");?>"><i class="fa fa-qrcode"></i> <span class="nav-label">分类管理</span></a>
                    </li>
                     <li <?php if(CONTROLLER_NAME == 'User'): ?>class="active"<?php endif; ?>>
                        <a href="<?php echo U("admin/user/index");?>"><i class="fa fa-group (alias)"></i> <span class="nav-label">会员管理</span></a>
                    </li>
                     <li <?php if(CONTROLLER_NAME == 'Website'): ?>class="active"<?php endif; ?>>
                        <a href="#"><i class="fa fa-gear (alias)"></i> <span class="nav-label">网站设置</span></a>
                    </li>
                  
                </ul>

            </div>
        </nav>

        <div id="page-wrapper" class="gray-bg dashbard-1">
          
             <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
            </div>
                <ul class="nav navbar-top-links navbar-right">
                    <li>
                        <span class="m-r-sm text-muted welcome-message">欢迎进入电商系统</span>
                    </li>
                    <li>
                        <a href="<?php echo U("admin/auth/logout");?>">
                            <i class="fa fa-sign-out"></i>退出
                        </a>
                    </li>
                </ul>

            </nav>
</div>      
            <div class="row">
                <div class="col-lg-12">
                <div class="wrapper wrapper-content">
                	<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-6">
        <h2>商品管理</h2>
        <ol class="breadcrumb">
            <li>
                <a href="index.html">主页</a>
            </li>
            
            <li class="active">
                <strong>商品管理</strong>
            </li>
        </ol>
    </div>
    <div class="col-md-6">
        <h2><a href="<?php echo U('admin/product/add');?>" class="btn btn-success btn-lg pull-right">商品添加</a></h2>
    </div>
    
</div>
<div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-md-12">
                    <div class="">
                 <table class="table">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>商品名称</th>
                        <th>分类</th>
                        <th>价格</th>
                        <th>库存</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if(is_array($products)): $i = 0; $__LIST__ = $products;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                            <td><?php echo ($vo["id"]); ?></td>
                            <td>
                                <img style="height:50px;" src="/tpshop2<?php echo ($vo["img"]); ?>">
                                <a href=""> <?php echo ($vo["title"]); ?></a>
                            </td>
                            <td><?php echo ($vo["name"]); ?></td>
                            <td>￥<?php echo ($vo["price"]); ?></td>
                            <td><?php echo ($vo["stock"]); ?></td>
                            <td><?php echo (product_status($vo["status"])); ?></td>
                            <td><?php if($vo['status'] == 1): ?><a href="<?php echo U('admin/product/ban/id/'.$vo['id']);?>" class="btn btn-warning btn-xs">下架</a>
                                 <?php else: ?>
                                 <a href="<?php echo U('admin/product/enable/id/'.$vo['id']);?>" class="btn btn-success btn-xs">上架</a><?php endif; ?>
                                <a href="<?php echo U('admin/product/edit/id/'.$vo['id']);?>" class="btn btn-primary btn-xs">编辑</a>
                                <a href="<?php echo U('admin/product/delete/id/'.$vo['id']);?>" class="btn btn-danger btn-xs delete">删除</a>
                            </td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                    </tbody>
                </table> 
                <?php echo ($page); ?> 
            </div>
        </div>
    </div>                 
</div>


                     <div class="footer">
                        
                        <div>
                            <strong>Copyright</strong> Example Company &copy;goodjobs.cn 2015-2016
                        </div>
  </div> 
                 </div>
                </div>
            </div>

        </div>
     </div>
    
</body>
</html>